<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>关爱健康</title>
    <meta name="description" content="关爱健康">
    <meta name="keywords" content="关爱健康">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <link rel="shortcut icon" href="../img/favicon.ico">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <!-- 引入组件库 -->
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript" src="../plugins/elementui/index.js"></script>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/axios-0.18.0.js"></script>
</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>健康评估<small>中医体质辨识</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>健康评估</el-breadcrumb-item>
            <el-breadcrumb-item>中医体质辨识</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="app-container">
        <div class="box">
            <div class="filter-container">
                <el-input placeholder="档案号/会员名称" v-model="pagination.queryString" style="width: 200px;"
                          class="filter-item"></el-input>
                <el-button @click="search()" class="dalfBut">查询</el-button>
                <el-button type="primary" class="butT" @click="handleCreate()">新建</el-button>
            </div>
            <el-table size="small" current-row-key="id" :data="dataList" border stripe highlight-current-row>
                <el-table-column type="index" align="center" label="序号"></el-table-column>
                <el-table-column prop="fileNumber" align="center" label="档案号" width="130px"></el-table-column>
                <el-table-column prop="name" label="会员名称" align="center" width="100"></el-table-column>
                <el-table-column prop="assessmentDate" label="评估日期" align="center" width="120"></el-table-column>
                <el-table-column label="性别" align="center" width="80">
                    <template slot-scope="scope">
                        <span>{{ scope.row.sex == '1' ? '男' : '女'}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="yangDeficiency" label="阳虚质" align="center" width="100"></el-table-column>
                <el-table-column prop="yinDeficiency" label="阴虚质" align="center" width="100"></el-table-column>
                <el-table-column prop="qiDeficiency" label="气虚质" align="center" width="100"></el-table-column>
                <el-table-column prop="phlegmDampness" label="痰湿质" align="center" width="100"></el-table-column>
                <el-table-column prop="hygrothermalMass" label="湿热质" align="center" width="100"></el-table-column>
                <el-table-column prop="bloodStasis" label="血瘀质" align="center" width="100"></el-table-column>
                <el-table-column prop="specialQuality" label="特禀质" align="center" width="100"></el-table-column>
                <el-table-column prop="qiStagnation" label="气郁质" align="center" width="100"></el-table-column>
                <el-table-column prop="peaceQuality" label="平和质" align="center" width="100"></el-table-column>
                <el-table-column label="操作" align="center" fixed="right" width="220px">
                    <template slot-scope="scope">
                        <el-button type="primary" round size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
                        <el-button type="danger" round size="mini" @click="handleDelete(scope.row)">删除</el-button>
                        <el-button type="success" round size="mini" @click="handleSee(scope.row)">查看</el-button>
                    </template>
                </el-table-column>
                <!--<el-table-column label="阳虚质" align="center" width="100">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.yangDeficiency === '1'" size="small">是</el-tag>
                        <el-tag v-else size="small" type="danger">否</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="阴虚质" align="center" width="100">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.yinDeficiency === '1'" size="small">是</el-tag>
                        <el-tag v-else size="small" type="danger">否</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="气虚质" align="center" width="100">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.qiDeficiency === '1'" size="small">是</el-tag>
                        <el-tag v-else size="small" type="danger">否</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="痰湿质" align="center" width="100">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.phlegmDampness === '1'" size="small">是</el-tag>
                        <el-tag v-else size="small" type="danger">否</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="湿热质" align="center" width="100">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.hygrothermalMass === '1'" size="small">是</el-tag>
                        <el-tag v-else size="small" type="danger">否</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="血瘀质" align="center" width="100">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.bloodStasis === '1'" size="small">是</el-tag>
                        <el-tag v-else size="small" type="danger">否</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="特禀质" align="center" width="100">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.specialQuality === '1'" size="small">是</el-tag>
                        <el-tag v-else size="small" type="danger">否</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="气郁质" align="center" width="100">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.qiStagnation === '1'" size="small">是</el-tag>
                        <el-tag v-else size="small" type="danger">否</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="平和质" align="center" width="100">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.peaceQuality === '1'" size="small">是</el-tag>
                        <el-tag v-else size="small" type="danger">否</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="操作" align="center" fixed="right" width="150px">
                    <template slot-scope="scope">
                        <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
                        <el-button type="danger" size="mini" @click="handleDelete(scope.row)">删除</el-button>
                    </template>
                </el-table-column>-->
            </el-table>
            <div class="pagination-container">
                <el-pagination
                        class="pagiantion"
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="pagination.currentPage"
                        :page-sizes="[10, 20, 30, 40, 50]"
                        :page-size="pagination.pageSize"
                        layout="total,sizes, prev, pager, next, jumper"
                        :total="pagination.total">
                </el-pagination>
            </div>
            <!-- 新增标签弹层 -->
            <div class="add-form">
                <el-dialog title="新增中医体质辨识" :visible.sync="dialogFormVisible" v-if="dialogFormVisible">
                    <template>
                        <el-tabs v-model="activeName" type="card">
                            <el-tab-pane label="基本信息" name="first">
                                <el-form ref="dataAddForm" :model="formData" :rules="rules" label-position="right"
                                         label-width="100px">
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="会员名称" prop="name">
                                                <el-select v-model="formData.name" placeholder="请选择会员信息"
                                                           @change="linkageMember">
                                                    <el-option
                                                            v-for="member in selectList"
                                                            :key="member.id"
                                                            :label="member.name"
                                                            :value="member.id">
                                                    </el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="档案号" prop="fileNumber">
                                                <el-input v-model="formData.fileNumber" disabled/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="性别">
                                                <el-select v-model="formData.sex" disabled>
                                                    <el-option label="男" value="1"></el-option>
                                                    <el-option label="女" value="2"></el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="评估日期" prop="assessmentDate">
                                                <el-date-picker v-model="formData.assessmentDate" type="date"
                                                                :picker-options="pickerOptions"
                                                                value-format="yyyy-MM-dd"/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-form>
                            </el-tab-pane>
                            <!--<el-tab-pane v-for="(pages,index) in tableData" :key="index" :label="pages.label">
                                <div class="checkScrol">
                                    <table class="datatable">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>请根据近一年的感觉，回答以下问题</th>
                                            <th width="65px">没有(1分)</th>
                                            <th width="65px">很少(2分)</th>
                                            <th width="65px">有时(3分)</th>
                                            <th width="65px">经常(4分)</th>
                                            <th width="65px">总是(5分)</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="(item1,indexs) in pages.values">
                                            <td><label :for="item1.id">{{item1.id}}</label></td>
                                            <td><label :for="item1.name">{{item1.name}}</label>

                                            <td v-for="(theanswer,index1) in item1.answer" :key="index1">
                                                <input type="radio" :name="item1.name" :value="theanswer.value"
                                                       @change="get_radio_value(indexs)"
                                                       v-model="checkedValue[indexs]">
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </el-tab-pane>-->
                            <el-tab-pane label="中医体质评测" name="second">
                                <div class="checkScrol">
                                    <table class="datatable">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>请根据近一年的感觉，回答以下问题</th>
                                            <th width="65px">没有(1分)</th>
                                            <th width="65px">很少(2分)</th>
                                            <th width="65px">有时(3分)</th>
                                            <th width="65px">经常(4分)</th>
                                            <th width="65px">总是(5分)</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="(c,index) in tableData">
                                            <td><label :for="c.id">{{c.id}}</label></td>
                                            <td><label :for="c.name">{{c.name}}</label></td>
                                            <td v-for="(theanswer,index1) in c.answer" :key="index1">
                                                <input type="radio" :name="c.name" :value="theanswer.value"
                                                       @change="get_radio_value(index)"
                                                       v-model="checkedValue[index]">
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </el-tab-pane>
                        </el-tabs>
                    </template>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="dialogFormVisible = false">取消</el-button>
                        <el-button type="primary" @click="handleAdd()">确定</el-button>
                    </div>
                </el-dialog>
            </div>

            <!-- 编辑标签弹层 -->
            <div class="add-form">
                <el-dialog title="编辑中医体质辨识" :visible.sync="dialogFormVisible4Edit" v-if="dialogFormVisible4Edit">
                    <template>
                        <el-tabs v-model="activeName" type="card">
                            <el-tab-pane label="基本信息" name="first">
                                <el-form ref="dataEditForm" :model="formData" :rules="rules" label-position="right"
                                         label-width="100px">
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="会员名称" prop="name">
                                                <el-select v-model="formData.name" placeholder="请选择会员信息"
                                                           @change="linkageMember" disabled>
                                                    <el-option
                                                            v-for="member in selectList"
                                                            :key="member.id"
                                                            :label="member.name"
                                                            :value="member.id">
                                                    </el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="档案号" prop="fileNumber">
                                                <el-input v-model="formData.fileNumber" disabled/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="性别">
                                                <el-select v-model="formData.sex" disabled>
                                                    <el-option label="男" value="1"></el-option>
                                                    <el-option label="女" value="2"></el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="评估日期" prop="assessmentDate">
                                                <el-date-picker v-model="formData.assessmentDate" type="date"
                                                                :picker-options="pickerOptions"
                                                                value-format="yyyy-MM-dd"/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-form>
                            </el-tab-pane>
                        </el-tabs>
                    </template>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="dialogFormVisible4Edit = false">取消</el-button>
                        <el-button type="primary" @click="handleEdit()">确定</el-button>
                    </div>
                </el-dialog>
            </div>

            <!-- 查看标签弹层 -->
            <div class="add-form">
                <el-dialog title="查看中医体质辨识" :visible.sync="dialogFormVisible4See" v-if="dialogFormVisible4See">
                    <template>
                        <el-tabs v-model="activeName" type="card">
                            <el-tab-pane label="基本信息" name="first">
                                <el-form ref="dataSeeForm" :model="formData" :rules="rules" label-position="right"
                                         label-width="100px">
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="会员名称" prop="name">
                                                <el-select v-model="formData.name" placeholder="请选择会员信息"
                                                           @change="linkageMember" disabled>
                                                    <el-option
                                                            v-for="member in selectList"
                                                            :key="member.id"
                                                            :label="member.name"
                                                            :value="member.id">
                                                    </el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="档案号" prop="fileNumber">
                                                <el-input v-model="formData.fileNumber" disabled/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="性别">
                                                <el-select v-model="formData.sex" disabled>
                                                    <el-option label="男" value="1"></el-option>
                                                    <el-option label="女" value="2"></el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="评估日期" prop="assessmentDate">
                                                <el-date-picker v-model="formData.assessmentDate" type="date"
                                                                :picker-options="pickerOptions"
                                                                value-format="yyyy-MM-dd" disabled/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="阳虚质">
                                                <el-input v-model="formData.yangDeficiency" disabled/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="阴虚质">
                                                <el-input v-model="formData.yinDeficiency" disabled/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="气虚质">
                                                <el-input v-model="formData.qiDeficiency" disabled/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="痰湿质">
                                                <el-input v-model="formData.phlegmDampness" disabled/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="湿热质">
                                                <el-input v-model="formData.hygrothermalMass" disabled/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="血瘀质">
                                                <el-input v-model="formData.bloodStasis" disabled/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="特禀质">
                                                <el-input v-model="formData.specialQuality" disabled/>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="气郁质">
                                                <el-input v-model="formData.qiStagnation" disabled/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="平和质">
                                                <el-input v-model="formData.peaceQuality" disabled/>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-form>
                            </el-tab-pane>
                        </el-tabs>
                    </template>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="dialogFormVisible4Edit = false">取消</el-button>
                        <el-button type="primary" @click="handleEdit()">确定</el-button>
                    </div>
                </el-dialog>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    var vue = new Vue({
        el: '#app',
        data: {
            pagination: {//分页相关模型数据
                currentPage: 1,//当前页码
                pageSize: 10,//每页显示的记录数
                total: 0,//总记录数
                queryString: null//查询条件
            },
            pickerOptions: {
                disabledDate(time) {
                    return time.getTime() > Date.now();
                },
                shortcuts: [{
                    text: '今天',
                    onClick(picker) {
                        picker.$emit('pick', new Date());
                    }
                }, {
                    text: '昨天',
                    onClick(picker) {
                        const date = new Date();
                        date.setTime(date.getTime() - 3600 * 1000 * 24);
                        picker.$emit('pick', date);
                    }
                }, {
                    text: '一周前',
                    onClick(picker) {
                        const date = new Date();
                        date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
                        picker.$emit('pick', date);
                    }
                }]
            },
            dataList: [],//当前页要展示的分页列表数据
            formData: {},//表单数据
            selectList: [],//会员数据
            checkedValue: [], // 绑定单选框的值
            //答案-分数
            answer: [
                {
                    'value': '1'
                }, {
                    'value': '2'
                }, {
                    'value': '3'
                }, {
                    'value': '4'
                }, {
                    'value': '5'
                }
            ],
            all_list: [],
            tableData: [],//新增和编辑表单中对应的检查项列表数据
            activeName: "first",
            dialogFormVisible: false,//增加表单是否可见
            dialogFormVisible4Edit: false,//编辑表单是否可见
            dialogFormVisible4See: false,//查看表单是否可见
            rules: {//校验规则
                name: [{required: true, message: '会员名称为必填项', trigger: 'blur'}],
                fileNumber: [{required: true, message: '档案为必填项', trigger: 'blur'}],
                assessmentDate: [{required: true, message: '评估日期为必填项', trigger: 'blur'}],
            }
        },
        //钩子函数，VUE对象初始化完成后自动执行
        created() {
            this.findPage();
        },
        methods: {
            //将结果添加到all_list数组中
            get_radio_value: function (index) {
                // 获取当前radio当前值
                // console.log((index + 1) + '题' + this.checkedValue);
                this.all_list[index] = this.checkedValue[index];
                // console.log(this.all_list[index])
            },
            //VUE日期转换
            dateFormat: function (time) {
                var date = new Date(time);
                var year = date.getFullYear();
                /* 在日期格式中，月份是从0开始的，因此要加0
                 * 使用三元表达式在小于10的前面加0，以达到格式统一  如 09:11:05
                 * */
                var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
                var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
                // 拼接
                return year + "-" + month + "-" + day;
            },
            //选择会员-联动数据显示
            linkageMember(val) {
                let obj = {};
                obj = this.selectList.find((item) => {
                    return item.id === val;
                });
                // console.log(obj)
                this.formData.name = obj.name;
                this.formData.fileNumber = obj.fileNumber;
                this.formData.sex = obj.sex;
                return;
            },
            //没有操作权限弹出框
            showMessage(r) {
                if (r == 'Error: Request failed with status code 403') {
                    //权限不足
                    this.$message.error('无访问权限');
                    return;
                } else {
                    this.$message.error('未知错误');
                    return;
                }
            },
            //编辑
            handleEdit() {
                axios.post("/health/editCmedicineMember.do", this.formData).then((res) => {
                    //关闭编辑窗口
                    this.dialogFormVisible4Edit = false;
                    if (res.data.flag) {
                        this.$message.success(res.data.message);
                    } else {
                        this.$message.error(res.data.message);
                    }
                }).catch((res) => {
                    this.showMessage(res);
                }).finally(() => {
                    this.findPage();
                });
            },
            //添加
            handleAdd() {
                //校验
                this.$refs['dataAddForm'].validate((valid) => {
                    if (valid) {
                        this.activeName = "first";
                        // --------------对答案做出处理---start--------------
                        for (var i = 0; i < this.all_list.length; i++) {
                            if (this.all_list[i] === '' || typeof (this.all_list[i]) === 'undefined') {
                                this.all_list.splice(i, 1)
                            }
                        }
                        // 循环
                        if (this.tableData.length !== this.all_list.length) {
                            // console.log('答案没有选择完毕')
                            this.$message.error("请回答完毕所有中医体质辨识题，再提交档案!");
                            return false;
                        }
                        // --------------对答案做出处理---end--------------
                        axios.post("/health/addCmedicineMember.do?answerList=" + this.all_list, this.formData).then((res) => {
                            if (res.data.flag) {
                                this.tableData = res.data.data;
                                this.$message.success(res.data.message);
                            } else {
                                this.$message.error(res.data.message);
                            }
                        }).catch((res) => {
                            this.showMessage(res);
                        }).finally(() => {
                            this.dialogFormVisible = false;
                            this.findPage();
                        });
                    } else { // 失败
                        this.$message.error("数据校验失败，请检查你的输入信息是否正确!");
                        return false;
                    }
                });
            },
            search() {
                this.pagination.currentPage = 1;
                this.findPage();
            },
            //分页查询
            findPage() {
                axios.post("/health/findCmedicineMemberByPage.do", {
                    currentPage: this.pagination.currentPage,
                    pageSize: this.pagination.pageSize,
                    queryString: this.pagination.queryString
                }).then((res) => {
                    this.pagination.total = res.data.total;
                    /*循环更改日期格式*/
                    for (i in res.data.rows) {
                        res.data.rows[i].assessmentDate = this.dateFormat(res.data.rows[i].assessmentDate);
                    }
                    this.dataList = res.data.rows;
                }).catch((res) => {
                    this.showMessage(res);
                });
            },
            // 重置表单
            resetForm(formName) {
                this.all_list = [];
                this.formData = {};
                this.activeName = "first";
                if (this.$refs[formName] !== undefined) {
                    this.$refs[formName].resetFields()
                }
            },
            // 弹出添加窗口
            handleCreate() {
                this.dialogFormVisible = true;
                this.resetForm("dataAddForm");

                //查询所有会员
                axios.post("/member/findAll.do").then((res) => {
                    if (res.data.flag) {
                        this.selectList = res.data.data;
                    } else {
                        this.$message.error(res.data.message);
                    }
                }).catch((res) => {
                    this.showMessage(res);
                });

                //查询所有中医体质辨识题
                axios.post("/health/findAllCmedicine.do").then((res) => {
                    if (res.data.flag) {
                        // this.tableData = res.data.data;
                        /*for (var newStrId of JSON.parse(JSON.stringify(res.data.data))) {
                            for(var newStr of newStrId["values"]){
                                newStr['answer'] = this.answer;
                            }
                            this.tableData.push(newStrId)
                        }*/
                        for (var newStrId of JSON.parse(JSON.stringify(res.data.data))) {
                            newStrId['answer'] = this.answer;
                            this.tableData.push(newStrId);
                        }
                        // console.log(this.tableData);
                    } else {
                        this.$message.error(res.data.message);
                    }
                }).catch((res) => {
                    this.showMessage(res);
                });
            },
            // 弹出编辑窗口
            handleUpdate(row) {
                this.dialogFormVisible4Edit = true;
                this.resetForm("dataEditForm");
                axios.get("/health/findByIdWithAllCmedicineMember.do?id=" + row.id).then((res) => {
                    if (res.data.flag) {
                        this.formData = res.data.data[0];
                    } else {
                        this.$message.error(res.data.message);
                    }
                }).catch((res) => {
                    this.showMessage(res);
                });
            },
            // 初始页currentPage、初始每页数据数pagesize和数据data
            handleSizeChange(size) {
                this.pagination.pageSize = size;
                this.findPage();
            },
            //切换页码
            handleCurrentChange(currentPage) {
                this.pagination.currentPage = currentPage;
                this.findPage();
            },
            // 删除
            handleDelete(row) {
                this.$confirm('此操作将永久删除该中医体质辨识档案数据, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {//点击确认 - 执行
                    //用户点击确定按钮，发送ajax请求，将检查项ID提交到Controller进行处理
                    axios.get("/health/deleteCmedicineMember.do?id=" + row.id).then((res) => {
                        if (res.data.flag) {
                            this.$message.success(res.data.message);
                            this.findPage();
                        } else {
                            this.$message.error(res.data.message);
                        }
                    }).catch((res) => {
                        this.showMessage(res);
                    });
                }).catch(() => {//点击取消 - 执行
                    this.$message({
                        type: 'info',
                        message: '操作已取消'
                    });
                });
            },
            // 弹出查看窗口
            handleSee(row) {
                this.dialogFormVisible4See = true;
                this.resetForm("dataSeeForm");
                axios.get("/health/findByIdWithAllCmedicineMember.do?id=" + row.id).then((res) => {
                    if (res.data.flag) {
                        this.formData = res.data.data[0];
                    } else {
                        this.$message.error(res.data.message);
                    }
                }).catch((res) => {
                    this.showMessage(res);
                });
            },
        }
    })
</script>
</html>